﻿namespace CShorpPro;

public class Phone
{
    // 品牌
    public string Brand { get; set; }
    
    // 重量（单位：g）
    public ushort Weight { get; set; }
    
    // 后置摄像头像素
    public uint CameraPixel { get; set; }
    
    // 价格
    public decimal Price { get; set; }
    
    // 构造函数
    public Phone(string brand, ushort weight, uint cameraPixel, decimal price)
    {
        Brand = brand;
        Weight = weight;
        CameraPixel = cameraPixel;
        Price = price;
    }
    
    // 打印手机信息的方法
    public void PrintPhoneInfo()
    {
        Console.WriteLine("手机信息：");
        Console.WriteLine($"品牌(Brand): {Brand}");
        Console.WriteLine($"重量(Weight): {Weight}g");
        Console.WriteLine($"后置摄像头像素(Camera): {CameraPixel:N0}".Replace(",", ","));
        Console.WriteLine($"价格(Price): ¥{Price:N2}");
    }
}